//
//  ImageManager.m
//  muscleLife
//
//  Created by xalo on 16/5/3.
//  Copyright © 2016年 HeavenAndHell. All rights reserved.
//

#import "ImageManager.h"

@implementation ImageManager

//-(NSArray *)sumArray{
//    if (!_sumArray) {
//        _sumArray=
//    }
//}
-(NSMutableArray *)dishes{
    if (!_dishes) {
        _dishes=[NSMutableArray arrayWithObjects:@"http://img5.imgtn.bdimg.com/it/u=2188988938,1494369433&fm=21&gp=0.jpg",
                 @"http://img0.imgtn.bdimg.com/it/u=954126948,473723970&fm=21&gp=0.jpg",
                 @"http://img1.imgtn.bdimg.com/it/u=4278033346,1077072877&fm=21&gp=0.jpg",
                 @"http://img2.imgtn.bdimg.com/it/u=3428136924,3604979610&fm=21&gp=0.jpg",
                 @"http://img2.imgtn.bdimg.com/it/u=2143893576,3860361474&fm=21&gp=0.jpg",
                 @"http://img4.imgtn.bdimg.com/it/u=2562340856,1706484188&fm=21&gp=0.jpg",
                 @"http://img4.imgtn.bdimg.com/it/u=4087840414,1599015166&fm=21&gp=0.jpg",
                 @"http://img4.imgtn.bdimg.com/it/u=2600953463,1594795007&fm=21&gp=0.jpg", nil];
    }
    return _dishes;
}
-(NSArray *)craft{
    if (!_craft) {
        _craft=[NSArray arrayWithObjects:@"http://img4.imgtn.bdimg.com/it/u=355647686,3720534332&fm=21&gp=0.jpg",
                @"http://img2.imgtn.bdimg.com/it/u=1025110841,165756759&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=869337436,3377371310&fm=21&gp=0.jpg",
                @"http://img4.imgtn.bdimg.com/it/u=3613147147,3682795465&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=433234455,1272704991&fm=21&gp=0.jpg",
                @"http://img3.imgtn.bdimg.com/it/u=3422092198,1277795313&fm=21&gp=0.jpg",
                @"http://img2.imgtn.bdimg.com/it/u=2504506678,2618250248&fm=21&gp=0.jpg",
                @"http://img4.imgtn.bdimg.com/it/u=31916487,3049397587&fm=21&gp=0.jpg",
                @"http://img3.imgtn.bdimg.com/it/u=2625225511,2051419482&fm=21&gp=0.jpg",
                @"http://img3.imgtn.bdimg.com/it/u=435744551,606651268&fm=21&gp=0.jpg",
                @"http://img2.imgtn.bdimg.com/it/u=1480501308,4090438590&fm=21&gp=0.jpg",
                @"http://img5.imgtn.bdimg.com/it/u=2718348506,613431207&fm=21&gp=0.jpg",
                @"http://img1.imgtn.bdimg.com/it/u=1756707330,81280201&fm=21&gp=0.jpg",
                @"http://img4.imgtn.bdimg.com/it/u=1783875076,4010942734&fm=21&gp=0.jpg",
                @"http://img3.imgtn.bdimg.com/it/u=384467216,1356106171&fm=21&gp=0.jpg ", nil];
    }
    return _craft;
}

-(NSArray *)cuisine{
    if (!_cuisine) {
        _cuisine=[NSArray arrayWithObjects:@"http://img1.imgtn.bdimg.com/it/u=2028878660,2203921931&fm=21&gp=0.jpg",
                  @"http://img3.imgtn.bdimg.com/it/u=478547811,359067354&fm=21&gp=0.jpg",
                  @"http://img4.imgtn.bdimg.com/it/u=2995445767,4036324159&fm=21&gp=0.jpg",
                  @"http://img2.imgtn.bdimg.com/it/u=1783472734,1384479592&fm=21&gp=0.jpg",
                  @"http://img0.imgtn.bdimg.com/it/u=455444753,3162391351&fm=21&gp=0.jpg",
                  @"http://img2.imgtn.bdimg.com/it/u=3199373451,249812141&fm=21&gp=0.jpg",
                  @"http://img4.imgtn.bdimg.com/it/u=4015111885,1694004169&fm=21&gp=0.jpg",
                  @"http://img2.imgtn.bdimg.com/it/u=307230531,1662301553&fm=21&gp=0.jpg",
                  @"http://img0.imgtn.bdimg.com/it/u=3686158691,1961350277&fm=21&gp=0.jpg",
                  @"http://img5.imgtn.bdimg.com/it/u=194996458,1950165229&fm=21&gp=0.jpg",
                  @"http://img3.imgtn.bdimg.com/it/u=2651587093,4237905948&fm=21&gp=0.jpg",
                  @"http://img5.imgtn.bdimg.com/it/u=3554369621,4009352650&fm=21&gp=0.jpg",
                  @"http://img4.imgtn.bdimg.com/it/u=3712873018,3723648214&fm=21&gp=0.jpg",
                  @"http://img2.imgtn.bdimg.com/it/u=1010413879,3121152529&fm=21&gp=0.jpg",
                  @"http://img3.imgtn.bdimg.com/it/u=2176028885,1796576782&fm=21&gp=0.jpg",
                  @"http://img4.imgtn.bdimg.com/it/u=3532278221,1047091551&fm=21&gp=0.jpg",
                  @"http://img2.imgtn.bdimg.com/it/u=3869963676,775249110&fm=21&gp=0.jpg ", nil];
    }
    return _cuisine;
}

-(NSArray *)crowd{
    if (!_crowd) {
        _crowd=[NSArray arrayWithObjects:@"http://img1.imgtn.bdimg.com/it/u=2749570639,2506138396&fm=21&gp=0.jpg",
                @"http://img2.imgtn.bdimg.com/it/u=2235045360,3406993926&fm=21&gp=0.jpg",
                @"http://img2.imgtn.bdimg.com/it/u=2336997567,2976067167&fm=21&gp=0.jpg",
                @"http://img3.imgtn.bdimg.com/it/u=3812025440,757140389&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=277476002,3936780910&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=3893929026,333070452&fm=21&gp=0.jpg",
                @"http://img1.imgtn.bdimg.com/it/u=2555524749,563789062&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=1144248548,1442902414&fm=21&gp=0.jpg",
                @"http://img0.imgtn.bdimg.com/it/u=2347263096,2168050528&fm=21&gp=0.jpg", nil];
    }
    return _crowd;
}
-(NSArray *)function{
    if (!_function) {
        _function=[NSArray arrayWithObjects:@"http://img2.imgtn.bdimg.com/it/u=437366112,1151226422&fm=21&gp=0.jpg",
                   @"http://img2.imgtn.bdimg.com/it/u=280953549,3269291969&fm=21&gp=0.jpg",
                   @"http://img3.imgtn.bdimg.com/it/u=2224923323,158145586&fm=21&gp=0.jpg",
                   @"http://img1.imgtn.bdimg.com/it/u=1195350845,3299800836&fm=21&gp=0.jpg",
                   @"http://img0.imgtn.bdimg.com/it/u=4059765153,1307682655&fm=21&gp=0.jpg",
                   @"http://img4.imgtn.bdimg.com/it/u=1870621632,591455422&fm=11&gp=0.jpg",
                   @"http://img2.imgtn.bdimg.com/it/u=3836453322,1274247510&fm=21&gp=0.jpg",
                   @"http://img4.imgtn.bdimg.com/it/u=3543466356,247857064&fm=21&gp=0.jpg",
                   @"http://img2.imgtn.bdimg.com/it/u=1734184724,3392483686&fm=21&gp=0.jpg",
                   @"http://img3.imgtn.bdimg.com/it/u=3870516053,4003596110&fm=21&gp=0.jpg",
                   nil];
    }
    return _function;
}


-(void)searchDishesFilefinished:(imageblock)imageblock{
    AVQuery *query = [AVQuery queryWithClassName:@"HealthImage"];
    [query whereKey:@"ImageName" containsString:@"dishes"];
    [query orderByAscending:@"ImageName"];
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
        if (imageblock) {
            imageblock(objects);
        }
    }];
}

@end
